package com.example.mapper.medical;

import com.example.model.entity.medical.Hospital;
import com.example.model.entity.other.Account;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作Hospital相关数据接口
*/
public interface HospitalMapper {

    /**
      * 新增
    */
    int insert(Hospital Hospital);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(Hospital Hospital);

    /**
      * 根据ID查询
    */
    Hospital selectById(Integer id);

    /**
      * 查询所有
    */
    List<Hospital> selectAll(Hospital Hospital);

    void updateStatus(@Param("ids") List<Integer> ids, @Param("status") String status);

    @Select("select * from hospital where username = #{username}")
    Hospital selectByUsername(String username);
    @Select("select * from hospital where city = #{city} and level=#{level} and status='正常'")
    List<Hospital> selectByInfo(String city, String level);
    @Select("SELECT * FROM hospital WHERE city = #{city} ")
    List<Hospital> selectByCity(@Param("city") String city);
}
